<?php 
class Account extends CI_Controller { 
	public function index() {
		if (!$this->customer->isLogged()) {
	  		$this->session->set_userdata('redirect', site_url('account/account'));
	  
	  		redirect(site_url('account/login'));
    	} 
	
		$this->lang->load('account/account');

		$this->document->setTitle($this->lang->line('heading_title'));

      	$data['breadcrumbs'] = array();

      	$data['breadcrumbs'][] = array(
        	'text'      => $this->lang->line('text_home'),
			'href'      => site_url('common/home'),
        	'separator' => false
      	); 

      	$data['breadcrumbs'][] = array(       	
        	'text'      => $this->lang->line('text_account'),
			'href'      => site_url('account/account'),
        	'separator' => $this->lang->line('text_separator')
      	);
		
		if ($this->session->userdata('success')) {
    		$data['success'] = $this->session->userdata('success');
			
			$this->session->unset_userdata('success');
		} else {
			$data['success'] = '';
		}
		
    	$data['heading_title'] = $this->lang->line('heading_title');

    	$data['text_my_account'] = $this->lang->line('text_my_account');
		$data['text_my_orders'] = $this->lang->line('text_my_orders');
		$data['text_my_newsletter'] = $this->lang->line('text_my_newsletter');
    	$data['text_edit'] = $this->lang->line('text_edit');
    	$data['text_password'] = $this->lang->line('text_password');
    	$data['text_address'] = $this->lang->line('text_address');
		$data['text_wishlist'] = $this->lang->line('text_wishlist');
    	$data['text_order'] = $this->lang->line('text_order');
    	$data['text_download'] = $this->lang->line('text_download');
		$data['text_reward'] = $this->lang->line('text_reward');
		$data['text_return'] = $this->lang->line('text_return');
		$data['text_transaction'] = $this->lang->line('text_transaction');
		$data['text_newsletter'] = $this->lang->line('text_newsletter');

    	$data['edit'] = site_url('account/edit');
    	$data['password'] = site_url('account/password');
		$data['address'] = site_url('account/address');
		$data['wishlist'] = site_url('account/wishlist');
    	$data['order'] = site_url('account/order');
    	$data['download'] = site_url('account/download');
		$data['reward'] = site_url('account/reward');
		$data['return'] = site_url('account/accountreturn');
		$data['transaction'] = site_url('account/transaction');
		$data['newsletter'] = site_url('account/newsletter');
		
		
				
		$data['header'] = helper_load_header();
		$data['column_left'] = helper_load_left();
		$data['column_right'] = helper_load_right();
		$data['content_top'] = helper_load_top();
		$data['content_bottom'] = helper_load_bottom();
		$data['footer'] = helper_load_footer();
		
		
		$this->load->view("account/account", $data);
  	}
}
?>